import React, { Component } from "react";
import Page from "../components/Page";

export default class Page1 extends Component {
  constructor() {
    super();
    this.state = {
      total: 150,
      shownum: 10,
    };
  }
  onChange = (index) => {
    alert("去请求第" + index + "页的数据");
  };

  render() {
    return (
      <div>
        总数{" "}
        <input
          value={this.state.total}
          onChange={(e) => {
            this.setState({
              total: e.target.value * 1,
            });
          }}
        />
        <h3>分组组件</h3>
        <Page
          total={this.state.total}
          showPage={9}
          shownum={this.state.shownum}
          onChange={this.onChange}
        ></Page>
      </div>
    );
  }
}
